home *** CD-ROM | disk | FTP | other *** search
/ GFX Sensations 1 / Graphic Sensations - Volume 1.iso / tools / amiga / 3d_tools / irit40s.lha / Irit / grapdrvs / draw_obj.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-30  |  1.4 KB  |  50 lines

  1. /*****************************************************************************
  2. *   Default object drawing routine common to graphics drivers.             *
  3. *                                         *
  4. * Written by:  Gershon Elber                Ver 0.1, June 1993.  *
  5. *****************************************************************************/
  6.  
  7. #include "irit_sm.h"
  8. #include "iritprsr.h"
  9. #include "cagd_lib.h"
  10. #include "iritgrap.h"
  11.  
  12. /****************************************************************************
  13. * Draw a single object using current modes and transformations.            *
  14. ****************************************************************************/
  15. void IGDrawObject(IPObjectStruct *PObj)
  16. {
  17.     CagdRType *R;
  18.     PointType Pt;
  19.  
  20.     switch (PObj -> ObjType) {
  21.     case IP_OBJ_POLY:
  22.         IGDrawPoly(PObj);
  23.         break;
  24.     case IP_OBJ_CTLPT:
  25.         /* Coerce, in place, a control points to a regular point. */
  26.         R = PObj -> U.CtlPt.Coords;
  27.         CagdCoercePointTo(Pt, CAGD_PT_E3_TYPE,
  28.                   &R, -1, PObj -> U.CtlPt.PtType);
  29.         PT_COPY(PObj -> U.Pt, Pt);
  30.         PObj -> ObjType = IP_OBJ_POINT;
  31.     case IP_OBJ_POINT:
  32.         IGDrawPtVec(PObj);
  33.         break;
  34.     case IP_OBJ_VECTOR:
  35.         IGDrawPtVec(PObj);
  36.         break;
  37.     case IP_OBJ_CURVE:
  38.         IGDrawCurve(PObj);
  39.         break;
  40.     case IP_OBJ_SURFACE:
  41.         IGDrawSurface(PObj);
  42.         break;
  43.     case IP_OBJ_LIST_OBJ:
  44.         IritFatalError("Should not have lists at this time");
  45.         break;
  46.     default:
  47.         break;
  48.     }
  49. }
  50.